<?php
/**
* 路由设置
*/
class Route
{
	
	public function GetRoute()
	{
					
			$c = $_SERVER["REQUEST_URI"];

			$d = strpos($c,"?");
			$d2 = strpos($c,"&");

			if($d){
				if($d2>0){
					$url = substr($c,$d,$d2-$d);
					$url2= substr($c,$d2);
				}else{
					$url = substr($c,$d);
				}



				if($url){

					$url = trim($url, '/');
					$urlArray = explode('/', $url);
					$controller[]=array();
					$controller["url"]=$this->qudenghao($urlArray[0],"=");
					$controller["controller"]=$urlArray[1];
					$controller["controller2"]=$urlArray[2];
					$controller["fun"]=$urlArray[3];
					if(isset($url2)){
						$url2 = trim($url2, '/');
						$urlArray2 = explode('/', $url2);
						$controller["canshu"][]=array();
						$controller["canshu"]=$urlArray2;
						$controller["canshu"][0]=$this->qudenghao($urlArray2[0],"=");
					}
					return $controller;
				}
			}else{
				return ;
			}
            

	}

	public function qudenghao($wz,$nr){

			$d = strpos($wz,$nr);

			$url = substr($wz,$d+1);

			return $url;



	}
}